const express = require('express');
const router = express.Router();
const bannerController = require('../controllers/banner.controller');
const {
  recordClickValidation,
  getBannerStatsValidation
} = require('../middlewares/banner.validator');

// 获取前端轮播图列表
// GET /api/banners?platform=mobile&limit=10
router.get('/', bannerController.getBanners);

// 记录轮播图点击
// POST /api/banners/:id/click
router.post('/:id/click', recordClickValidation, bannerController.recordClick);

// 获取轮播图统计信息
// GET /api/banners/stats?startDate=2024-01-01&endDate=2024-12-31
router.get('/stats', getBannerStatsValidation, bannerController.getBannerStats);

module.exports = router;
